<?php
return [
    'timeZone' => 'Asia/Shanghai',
    'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
    'bootstrap' => ['wlog'],
    'components' => [
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => \yii\log\DbTarget::className(),
                    'levels' => ['error'],
                ],
            ],
        ],
        'wlog' => [
            'class' => \wodrow\yii2wlog\Wlog::class,
            'only' => ['app-api'],
            'autoSaveAfterAction' => true,
        ],
        'monolog' => [ // Yii::$app->monolog->getLogger('main')->log('info', 'Hello world');
            'class' => '\Mero\Monolog\MonologComponent',
            'channels' => [
                'main' => [
                    'handler' => [
                        [
                            'type' => 'stream',
                            'path' => '@app/runtime/logs/main_' . date('Y-m-d') . '.log',
                            'level' => 'debug'
                        ]
                    ],
                    'processor' => [],
                ],
                'channel1' => [
                    'handler' => [
                        [
                            'type' => 'stream',
                            'path' => '@app/runtime/logs/channel1_' . date('Y-m-d') . '.log',
                            'level' => 'debug'
                        ]
                    ],
                ],
                'channel2' => [
                    'handler' => [
                        [
                            'type' => 'stream',
                            'path' => '@app/runtime/logs/channel1_' . date('Y-m-d') . '.log',
                            'level' => 'debug'
                        ]
                    ],
                ],
            ],
        ],
        'pinyin' => [ // 汉字转拼音
            'class' => \common\components\tools\PinYin::className(),
        ],
    ],
];
